home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_riv_towerwpnts.cog < prev    next >
Text File  |  1999-11-15  |  8KB  |  330 lines

  1. # Jones 3D Cog Script
  2. #
  3. # Riv_TowerWpnts.cog
  4. #
  5. # [TRM]
  6. #
  7. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  8. #========================================================================================
  9.  
  10. symbols
  11.    
  12.     message     startup
  13.     message        user0      
  14.     message        user1
  15.     message     entered
  16.     message     killed
  17.     
  18.     # ** commies **
  19.     thing       com1
  20.     thing       com2
  21.     thing       com3
  22.     thing       com4
  23.     
  24.     # ** com3 waypoints **
  25.     thing       t_Wpnt0
  26.     thing       t_Wpnt1
  27.     thing       t_Wpnt2
  28.     thing       t_Wpnt3
  29.     thing       t_Wpnt4
  30.     thing       t_Wpnt5
  31.     thing       t_Wpnt6
  32.     thing       t_Wpnt7
  33.     thing       t_Wpnt8
  34.     thing       t_Wpnt9
  35.     thing       t_Wpnt10
  36.     thing       t_Wpnt11
  37.     thing       t_Wpnt12
  38.     thing       t_Wpnt13
  39.     thing       t_Wpnt14
  40.     thing       t_Wpnt15
  41.     thing       t_Wpnt16
  42.     thing       t_Wpnt17
  43.     thing       t_Wpnt18
  44.     thing       t_Wpnt19
  45.     thing       t_Wpnt20
  46.     thing       t_Wpnt21
  47.     thing       t_Wpnt22
  48.     thing       t_Wpnt23
  49.     thing       t_Wpnt24
  50.     thing       t_Wpnt25
  51.     thing       t_Wpnt26
  52.     thing       t_Wpnt27
  53.     thing       t_Wpnt28
  54.     thing       t_Wpnt29
  55.     thing       t_Wpnt30
  56.     
  57.     sector      sec_Activate1       linkID=1
  58.     sector      sec_Activate2       linkID=1
  59.     sector      sec_Activate3       linkID=1        # raft house
  60.     sector      sec_Deactivate1     linkID=0
  61.     sector      sec_Deactivate2     linkID=0
  62.     sector      sec_Deactivate3     linkID=0        # raft house
  63.     
  64.     int         n_pos=0         local
  65.     int         n_Wpnts=31      local
  66.     int         wpntsActive=1   local
  67.     
  68.     # ** subroutines **
  69.     flex        activate_Wpnts      local
  70.     flex        deactivate_Wpnts    local
  71.     
  72. end
  73.  
  74. #========================================================================================
  75.  
  76. code
  77.  
  78. startup:
  79.  
  80.     # prepare commies for boarder cutscene
  81.     
  82.     if(GetPerformanceLevel() == 0)
  83.     {
  84.         SetThingFlags(com1, 0x80000);
  85.         SetThingFlags(com2, 0x80000);   
  86.     }
  87.     
  88.     else
  89.     {
  90.         AISetCutsceneMode(com1);
  91.         AISetCutsceneMode(com2);
  92.     }
  93.     
  94.     AISetCutsceneMode(com3);
  95.     
  96.     return;
  97.  
  98. #========================================================================================
  99.  
  100. entered:
  101.  
  102.     if(GetSenderID() == 1)
  103.     {
  104.         call activate_Wpnts;
  105.     }
  106.     
  107.     if(GetSenderID() == 0)
  108.     {
  109.         call deactivate_Wpnts;
  110.     }
  111.     
  112.     return;
  113.     
  114. #========================================================================================
  115.  
  116. user0:
  117.  
  118.     # restore commie 'brains'
  119.     
  120.     if(GetPerformanceLevel() > 0)
  121.     {
  122.         AIClearCutsceneMode(com1);
  123.         AIClearCutsceneMode(com2);
  124.     }
  125.     
  126.     AIClearCutsceneMode(com3);
  127.     
  128.     Sleep(0.01);
  129.     
  130.     for(n_pos = 0; n_pos < n_Wpnts; n_pos = n_pos + 1)
  131.     {
  132.         AISetWpnt(t_Wpnt0[n_pos], n_pos);
  133.     }
  134.  
  135.     # com3 waypoints (on tower)
  136.     AIConnectWpnts(0, 1);
  137.     AIConnectWpnts(1, 2);
  138.     
  139.     # com2 waypoints (near river)
  140.     AIConnectWpnts(3, 4);
  141.     AIConnectWpnts(4, 5);
  142.     AIConnectWpnts(5, 6);
  143.     AIConnectWpnts(6, 7);
  144.     
  145.     AIConnectWpnts(8, 9);
  146.     AIConnectWpnts(8, 10);
  147.     AIConnectWpnts(9, 10);
  148.     AIConnectWpnts(10,11);
  149.     
  150.     # com1 waypoints (near gate)
  151.     AIConnectWpnts(12, 13);
  152.     AIConnectWpnts(13, 14);
  153.     AIConnectWpnts(14, 15);
  154.     
  155.     # behind tower
  156.     AIConnectWpnts(16, 17);
  157.     AIConnectWpnts(16, 15);
  158.     AIConnectWpnts(17, 18);
  159.     
  160.     # other side of bridge
  161.     AIConnectWpnts(19, 20);
  162.     AIConnectWpnts(19, 21);
  163.     AIConnectWpnts(20, 21);
  164.     AIConnectWpnts(21, 22);
  165.     AIConnectWpnts(21, 19);
  166.     AIConnectWpnts(22, 23);
  167.     AIConnectWpnts(22, 19);
  168.     AIConnectWpnts(23, 24);
  169.     AIConnectWpnts(23, 21);
  170.     AIConnectWpnts(23, 22);
  171.     AIConnectWpnts(24, 25);
  172.     AIConnectWpnts(25, 23);
  173.     AIConnectWpnts(25, 26);
  174.     AIConnectWpnts(26, 27);
  175.     AIConnectWpnts(26, 28);
  176.     AIConnectWpnts(27, 28);
  177.     AIConnectWpnts(27, 25);
  178.     AIConnectWpnts(28, 29);
  179.     AIConnectWpnts(29, 30);
  180.     AIConnectWpnts(30, 27);
  181.     AIConnectWpnts(30, 28);
  182.     
  183.     if(GetPerformanceLevel() > 0)
  184.     {
  185.         AITraverseWpnts(com2, 3, 1.0, 20.0, 1);
  186.     }
  187.     
  188.     AITraverseWpnts(com3, 0, 1.0, 20.0, 1);
  189.     
  190.     Sleep(4.0);
  191.     
  192.     if(GetPerformanceLevel() > 0)
  193.     {
  194.         AITraverseWpnts(com1, 12, 1.0, 20.0, 1);
  195.     }
  196.     
  197.     return;
  198.  
  199. #========================================================================================
  200.  
  201. user1:
  202.  
  203.     if(GetPerformanceLevel() > 0)
  204.     {
  205.         AISetInstinctWpntMode(com1);
  206.         AIEnableInstinct(com1, "roam", 1);
  207.         
  208.         AISetInstinctWpntMode(com2);
  209.         AIEnableInstinct(com2, "roam", 1);
  210.     }
  211.     
  212.     AISetInstinctWpntMode(com3);
  213.     AIEnableInstinct(com3, "roam", 1);
  214.     
  215.     AISetInstinctWpntMode(com4);
  216.     
  217.     AIConnectWpnts(5, 7);
  218.     AIConnectWpnts(6, 4);
  219.     #AIConnectWpnts(5, 19);
  220.     #AIConnectWpnts(6, 20);
  221.     AIConnectWpnts(4, 8);
  222.     AIConnectWpnts(7, 9);
  223.     AIConnectWpnts(11, 8);
  224.     AIConnectWpnts(11, 12);
  225.     AIConnectWpnts(11, 13);
  226.     
  227.     AIConnectWpnts(18, 3);
  228.     
  229.     return;
  230.  
  231. #========================================================================================
  232.  
  233. killed:
  234.  
  235.     if(GetSenderRef() == com1) com1 = -1;
  236.     if(GetSenderRef() == com2) com2 = -1;
  237.     if(GetSenderRef() == com3) com3 = -1;
  238.     if(GetSenderRef() == com4) com4 = -1;
  239.     
  240.     return;
  241.  
  242. #========================================================================================
  243.  
  244. activate_Wpnts:
  245.  
  246.     if(wpntsActive == 1) return;
  247.     
  248. #    DebugPrint("TowerWpnts Activated!");
  249.     
  250.     wpntsActive = 1;
  251.  
  252.     if(GetPerformanceLevel() > 0)
  253.     {
  254.         if(com1 > -1)
  255.         {
  256.             AIClearCutsceneMode(com1);
  257.             AISetInstinctWpntMode(com1);
  258.             AIEnableInstinct(com1, "roam", 1);
  259.         }
  260.         
  261.         if(com2 > -1)
  262.         {
  263.             AIClearCutsceneMode(com2);
  264.             AISetInstinctWpntMode(com2);
  265.             AIEnableInstinct(com2, "roam", 1);
  266.         }
  267.     }
  268.     
  269.     if(com3 > -1)
  270.     {
  271.         AIClearCutsceneMode(com3);
  272.         AISetInstinctWpntMode(com3);
  273.         AIEnableInstinct(com3, "roam", 1);
  274.     }
  275.     
  276.     if(com4 > -1)
  277.     {
  278.         AIClearCutsceneMode(com4);
  279.         AISetInstinctWpntMode(com4);
  280.     }
  281.     
  282.     return;
  283.  
  284. #========================================================================================
  285.  
  286. deactivate_Wpnts:
  287.  
  288.     if(wpntsActive == 0) return;
  289.     
  290. #    DebugPrint("TowerWpnts Deactivated!");
  291.     
  292.     wpntsActive = 0;
  293.  
  294.     if(GetPerformanceLevel() > 0)
  295.     {
  296.         if(com1 > -1)
  297.         {
  298.             AIClearInstinctWpntMode(com1);
  299.             SetActorFlags(com1, 0x400);        # 0x400 = DEAF
  300.             AISetCutsceneMode(com1);
  301.         }
  302.         
  303.         if(com2 > -1)
  304.         {
  305.             AIClearInstinctWpntMode(com2);
  306.             SetActorFlags(com2, 0x400);        # 0x400 = DEAF
  307.             AISetCutsceneMode(com2);
  308.         }
  309.     }
  310.     
  311.     if(com3 > -1)
  312.     {
  313.         AIClearInstinctWpntMode(com3);
  314.         SetActorFlags(com3, 0x400);        # 0x400 = DEAF
  315.         AISetCutsceneMode(com3);
  316.     }
  317.     
  318.     if(com4 > -1)
  319.     {
  320.         AIClearInstinctWpntMode(com4);
  321.         SetActorFlags(com4, 0x400);        # 0x400 = DEAF
  322.         AISetCutsceneMode(com4);
  323.     }
  324.  
  325.     return;
  326.  
  327. #========================================================================================
  328.  
  329. end
  330.